package com.hziee.mail.service;

import com.hziee.mail.dao.ClassifyRepository;
import com.hziee.mail.model.ProductClassInfoEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author ZX
 */
@Service
public class ClassifyService {

    @Autowired
    private ClassifyRepository classifyRepository;

    public HashMap<String, Object> findclassifyLeft() {
        HashMap<String, Object> map = new HashMap<String, Object>(16);
        List<ProductClassInfoEntity> leftList = classifyRepository.findclassifyLeft();
        map.put("left", leftList);
        map.put("right", findclassifyRight("01"));
        return map;
    }

    public List<Map> findclassifyRight(String productClassId) {
        List<Map> list = classifyRepository.findclassifyRight(productClassId + "%");
        return list;
    }
}
